import Global from "../../Global";
import BaseView from "../../components/BaseView";

export default class UIView extends BaseView{
    private _enemy_info
    private _gold_coin
    private _enemy_count=0
    private _coin_count=0
    constructor(w?:number,h?:number){
        super(w,h)
        const lib=Global.getLibrary()
        //摧毁敌机数量
        this._enemy_info=new lib.EnemyCountInfo()
        this._enemy_info.txt_count.color="#fff"
        this._enemy_info.txt_count.text="0"
        this._enemy_info.setTransform(22,22)
        this.addChild(this._enemy_info)
        //金币数量
        this._gold_coin=new lib.GoldCoinInfo()
        this._gold_coin.txt_count.color="#fff"
        this._gold_coin.txt_count.text="0"
        this._gold_coin.setTransform(180,22)
        this.addChild(this._gold_coin)
    }
    inc_enemy_count():void{
        this._enemy_count++
        this._enemy_info.txt_count.text=this._enemy_count+''
    }
    inc_gold_count():void{
        this._coin_count++
        this._gold_coin.txt_count.text=this._coin_count+''
    }
    reflush(): void {
        //throw new Error("Method not implemented.");
    }
}